const bcrypt = require('bcryptjs')

async function generatePasswordHash() {
  const password = 'admin'
  const hashedPassword = await bcrypt.hash(password, 12)
  
  console.log('原密码:', password)
  console.log('加密后的密码:', hashedPassword)
  
  console.log('\n请执行以下SQL语句来更新admin密码:')
  console.log(`UPDATE users SET password = '${hashedPassword}' WHERE username = 'admin';`)
}

generatePasswordHash().catch(console.error)
